package com.sg.business.commons.labelprovider.project;

import java.util.List;

import com.mobnut.db.model.PrimaryObject;
import com.sg.business.model.ProjectStep;
import com.sg.widgets.commons.labelprovider.ConfiguratorColumnLabelProvider;

public class ProjectStepStartWorkLabelProvider extends
		ConfiguratorColumnLabelProvider {

	@Override
	public String getText(Object element) {
		if (element instanceof ProjectStep) {
			ProjectStep projectStep = (ProjectStep) element;
			List<PrimaryObject> startWorks = projectStep.getStartWorks();
			if (startWorks != null && startWorks.size() > 0) {
				String result = "";
				for (PrimaryObject po : startWorks) {
					if (result != "") {
						result += ",";
					}
					result += po.getDesc();
				}
				return result;
			}
		}
		return "";
	}

}
